<?php
	$path_one = 'admin/admin_project';
	$path_two = 'admin/admin_project_manage';
	$filename = 'admin/admin_project_list';
	require_once("header.php");
	require_once("admin_comm.php");
	require_once $_site->get_handlepath('project');
	$page=request('page',false,true,false,1);
	$pagesize=request('pagesize',false,true,false,10);
	$data['state']=request('state',false,true,false,0);
	$data['title']=$title=request('title');
	$result = project_fun_get_project_list($data,$page,$pagesize);
	$hover[$data['state']]=' class="hover" ';

?>
<script type="text/javascript" charset="utf-8">

	loader.file({
		plugin:['validform/main','dialog/main'],
		skincss:['list']
	})

</script>
</head>
<body>
	<div class="position_nav">你所在的当前位置：<?php echo $path_str;?></div>
		<div class="main">

		   <?php
		   if($cookie['group']==6){
           ?>
			<div class="sos_box">
				<form action="/admin/admin_project_list" id="search" method='get'>
					<span>项目名称/负责人：</span>
					<input type="text" value="<?php echo $title ;?>" name='title' class='ipt5'>
					<input type="hidden" value="<?php echo $data['state'] ;?>" name='state'>

					<input class="button1" type="submit" value="搜索">
				</form>
			</div>
			<?php 
			}
			?>
			
			<div class="power_nav">
				<ul>
					<li <?php echo $hover[0] ;?>>
						<a href="/admin/admin_project_list?state=0&<?php echo preg_replace('/(&page=\d*)|(&state=\d*)|(&v=\w+\/\w+)/','',$_SERVER['QUERY_STRING']) ;?>">全部</a>
					</li>
					<li <?php echo $hover[1] ;?>>
						<a href="/admin/admin_project_list?state=1&<?php echo preg_replace('/(&page=\d*)|(&state=\d*)|(&v=\w+\/\w+)/','',$_SERVER['QUERY_STRING']) ;?>">开通</a>
					</li>
					<li<?php echo $hover[2] ;?>>
						<a href="/admin/admin_project_list?state=2&<?php echo preg_replace('/(&page=\d*)|(&state=\d*)|(&v=\w+\/\w+)/','',$_SERVER['QUERY_STRING']) ;?>">关闭</a>
					</li>
				</ul>
			</div>

			<table cellpadding="0" cellspacing="1" border="0" class="table">
				<tr>
					<th align="center">序号</th>
					<th align="left">项目负责人</th>
					<th align="left">项目名称</th>
					<th align="center">项目开始时间</th>
					<th align="center">项目结束时间</th>
					<th align="center">项目状态</th>
					<th align="left">项目地址</th>
					<th align="center">操作</th>
				</tr>
				<?php
					if($result['rows']){
						foreach ($result['rows'] as $v){
							?>
							<tr>
								<td align="center"><?php echo $v['id'] ;?></td>
								<td align="left"><?php echo $v['bname'] ;?></td>
								<td align="left"><?php echo $v['title'] ;?></td>
								<td align="center"><?php echo date('Y-m-d H:i',$v['start_time']) ;?></td>
								<td align="center"><?php echo date('Y-m-d H:i',$v['end_time']) ;?></td>
								<td align="center"><?php echo $v['state']==1?'<span style="color:#0b9900">开通</span>':'<span style="color:#ff0000">关闭</span>' ;?></td>
								<td align="left"><?php echo $v['address'];?></td>
								<td align="left" class="set_text">									
									<a href="/admin/admin_project_add?id=<?php echo $v['id'] ;?>">修改</a>
									<?php echo $v['state']==1?"<em>|</em> <a href='/admin/admin_project_bind_device?id={$v['id']}'>绑定设备</a>":''; ?>
									<em>|</em>
									<?php echo "<a href='/admin/admin_project_device_list?id={$v['id']}'>查看设备列表</a>";?>	
									<em>|</em>																	
									<a href='/admin/car_set_type?id=<?php echo $v['id']; ?>' target="_blank">参数设置</a>										
									<em>|</em>																	
									<a href='/admin/admin_project_map_full?id=<?php echo $v['id']; ?>' target="_blank">工地指挥官</a>								
							   </td>
					</tr>
							<?php
						}
					}else{
						?>
						<tr>
							<td colspan="8">暂无数据！</td>
						</tr>
						<?php
					}
				?>
				<tr>
					<td colspan="8">
						<div class="list_more">
							项目总数：<?php echo $result['row_count']?$result['row_count']:0 ;?>
							<?php
								echo page_method($result['row_count'], $page, $result['page_count'], 10, '?'.preg_replace('/(&page=\d*)/','',$_SERVER['QUERY_STRING']), false);
							?>
						</div>
					</td>
				</tr>
			</table>
		</div>
	</div>
</body>
</html>


